$(document).ready(function() {
  // save the occupation_name in the cookie
  $('#id_occ_continue').click(function() {
     occ_name = $('#id_occ_name').val();
     $.cookie('occupation_name', occ_name, { path: '/' });
  });

  $('#id_occ_continue_p').click(function() {
     occ_name = $('#id_occ_name_p').val();
     $.cookie('occupation_name', occ_name, { path: '/' });
  });

  $('a.example_occ').click(function() {
     occ_name = $(this).text();
     $.cookie('occupation_name', occ_name, { path: '/' });
  });
  
  $("form#consumer_teaser").submit(function(event){
    event.preventDefault();
    occ_name = $('#id_occ_name').val();
    $.cookie('occupation_name', occ_name, { path: '/' });
    window.location = $(this).attr("action");
  });
  
});


